<template>
  <view class="new-users copy-data" style="padding-top: 50px">
    <view class="mid" style="flex: 1; overflow: hidden">
      <scroll-view scroll-y="true" style="height: 100%">
        <view class="header-bgi"></view>
        <view class="head pad30">
          <view class="user-card">
            <view class="user-info">
              <image class="avatar" :src="userInfo.avatar.includes('https') ? userInfo.avatar : getImg + userInfo.avatar" v-if="userInfo.avatar" @click="goEdit()"></image>
              <image @tap="showLogin = true" v-else class="avatar" src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/20/f_20250320164147A002.png" mode=""></image>
              <view class="info" style="display: grid; gap: 10px">
                <view class="name" v-if="userInfo">
                  <span v-if="userInfo.nickname"> {{ userInfo.nickname }}</span>
                  <!-- <span v-else> 请先登录</span> -->
                  <view class="phone" v-if="!userInfo.phone && !isLogin" @tap="awdawgawdgrr">绑定手机号</view>
                  <view class="vip" v-if="userInfo.vip">
                    <image :src="getImg + userInfo.vipIcon" alt="" />
                    <view class="vip-txt">{{ userInfo.vipType || "" }}</view>
                  </view>
                  <!-- <div v-if="userInfo">
                    <image @click="initQrCode" src="https://www.wantongkonggu.cn/crmebimage/demoimage/二维码.png"
                      style="width: 20px; height: 20px; margin-left: 10px;" />
                  </div> -->
                </view>
                <view class="num" v-if="userInfo.phone" @click="goEdit()" style="display: flex">
                  <view class="num-txt" style="font-size: 24rpx">{{ userInfo.phone }}</view>
                  <view class="icon">
                    <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/21/edit_20250321104107A005.png" mode=""></image>
                  </view>
                </view>
                <view class="phone" v-if="!userInfo.phone && isLogin" @tap="bindPhone">绑定手机号</view>
              </view>
            </view>
            <!-- @click="goMenuPage('/pages_h5/myCenter/components/user_money')" -->
            <view class="num-wrapper">
              <view class="num-item" @click="goMenuPage('/pages_h5/myCenter/components/user_money')">
                <text class="num">{{ userInfo.integral ? Number(userInfo.integral).toFixed(2) : 0 }}</text>
                <view class="txt" style="position: relative"
                  >钱包余额
                  <!-- <span class="sblzh">可提现</span> -->
                  <image
                    v-if="Number(userInfo.integral).toFixed(2) > 0"
                    style="width: 60px; height: 24px"
                    class="sblzh"
                    src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/08/01/可提现_20250801110229A036.png"
                    mode=""
                  />
                </view>
              </view>
              <view class="num-item" @click="goMenuPage('/pages_h5/myCenter/components/user_integral')">
                <text class="num">{{ userInfo.gpWyPaymentAmount ? userInfo.gpWyPaymentAmount : "0.00" }}</text>
                <view class="txt">平台积分</view>
              </view>
              <!-- <view class="num-item" @click="goMenuPage('/pages_h5/myCenter/components/user_integral?type=1')">
                 <text class="num">{{ userInfo.integral ? userInfo.integral : 0 }}</text> 
                <view class="txt">平台积分分享</view>
              </view> -->
            </view>
          </view>
          <view class="contenBox pa zindex10 w100">
            <view class="slider-wrapper" v-if="imgUrls.length > 0">
              <swiper
                indicator-dots="true"
                :autoplay="autoplay"
                :circular="circular"
                :interval="interval"
                :duration="duration"
                indicator-color="rgba(255,255,255,0.6)"
                indicator-active-color="#fff"
              >
                <swiper-item v-for="(item, index) in imgUrls" :key="index" class="borRadius14">
                  <image :src="item.pic" class="slide-image" @click="navito(item.url)"></image>
                </swiper-item>
              </swiper>
            </view>
            <view class="user-menus" style="margin-top: 40rpx">
              <view class="menu-title">我的服务</view>
              <view class="list-box">
                <view class="item" v-for="(item, index) in MyMenus" :key="index" @click="navito(item.url)">
                  <image :src="item.type === 1 ? item.pic : getImg + item.pic"></image>
                  <text>{{ item.name }}</text>
                </view>
                <view class="item" @click="kefuClick">
                  <image :src="servicePic"></image>
                  <text>联系客服</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/xiyi_order')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/05/14/洗衣机_20250514105035A055.png"> </image>
                  <text>洗衣订单</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/aboutOur')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/06/17/关于我们_20250617105751A177.png"> </image>
                  <text>关于我们</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/tousu_jianyi')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/05/15/投诉建议_20250515094532A036.png"> </image>
                  <text>投诉建议</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/yaoqing_fanli')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/05/20/返利台账_20250520154643A077.png"> </image>
                  <text>邀请返利</text>
                </view>
                <!-- <view class="item" @click="navito('/pages_h5/myCenter/components/yaoqing_jilu')">
                  <image
                    src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/05/20/邀请记录_20250520091011A042.png">
                  </image>
                  <text>邀请记录</text>
                </view> -->
                <view class="item" @click="initQrCode">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/05/20/二维码_20250520141403A076.png"> </image>
                  <text>会员推广</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/user_address')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/06/16/收货地址_20250616164751A175.png"> </image>
                  <text>收货地址</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/user_integral?type=1')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/09/03/分享_20250903085131A005.png"> </image>
                  <text>平台积分分享</text>
                </view>
                <!--  <view class="item" @click="navito('/pages_h5/myCenter/qiandao')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/09/18/签到_20250918095344A053.png"> </image>
                  <text>签到有奖</text>
                </view> -->
                <view class="item" @click="navito('/pages_h5/myCenter/initSk')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/09/30/分享 (1)_20250930105816A001.png"> </image>
                  <text>推广有奖</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/recordList')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/09/18/签到_20250918095344A053.png"> </image>
                  <text>推广记录</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/voteindex')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/10/22/ic_面性_驾校报名_1_20251022085937A006.png"> </image>
                  <text>活动报名</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/votelist')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/10/22/投票_20251022090120A007.png"> </image>
                  <text>参与投票</text>
                </view>
                <view class="item" @click="navito('/pages_h5/myCenter/components/prizelist')">
                  <image src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/10/23/中奖记录_20251023093506A001.png"> </image>
                  <text>中奖记录</text>
                </view>
              </view>
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
    <!-- <view v-if="showCode" class="qrcode-popup">
      <div id="qrcodeMer"></div>
      <button @click="showCode = false">关闭</button>
    </view> -->
    <u-popup :show="showLogin" mode="bottom" style="overflow: auto">
      <view style="height: 100vh">
        <view v-if="loginPhone">
          <div style="overflow: auto">
            <view class="login_box">
              <view class="login_box_bgi">
                <view style="margin-left: 60rpx; font-size: 30px; color: #000; font-weight: bold; text-align: center"> 欢迎登录👏</view>
                <view style="margin-left: 60rpx; color: #999999">登录账号即可查看更多精彩资讯 </view>
              </view>
              <div class="bw" style="width: 90%; margin: 0 auto; margin-top: 79rpx">
                <image
                  :src="
                    loginTab
                      ? 'https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/04/08/%E7%BC%96%E7%BB%84%205@2x_20250408174512A008.png'
                      : 'https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/17/bg_login_20250317145715A006.png'
                  "
                  style="width: 100%; height: 601rpx; z-index: -1"
                >
                </image>
                <div style="display: flex; justify-content: space-between; padding: 0 120rpx; margin-top: -573rpx">
                  <span @click="loginTab = true">手机号登录</span>
                  <span @click="(loginPhone = false), (loginTab = false)">快捷登录</span>
                  <!-- <span @click="loginTab = false">账号登录</span> -->
                </div>
                <view style="padding: 40rpx 44rpx; margin-top: 50rpx">
                  <div class="input-label" style="margin-top: 20rpx">手机号</div>
                  <view class="input-field">
                    <u-input
                      border="surround"
                      prefixIconStyle="width: 36rpx; height: 32rpx; padding-right: 22rpx"
                      prefixIcon="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/17/zhanghao_20250317150010A008.png"
                      maxlength="11"
                      type="text"
                      placeholder="请输入手机号"
                      v-model="account"
                    ></u-input>
                  </view>
                  <div v-if="!loginTab" class="input-label" style="margin-top: 20rpx">密码</div>
                  <div v-if="!loginTab" class="input-field">
                    <u-input
                      prefixIconStyle="width: 36rpx; height: 32rpx; padding-right: 22rpx"
                      prefixIcon="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/17/mima_20250317145953A007.png"
                      class="input_class"
                      placeholder="请输入密码"
                      v-model="password"
                      :password="passwordType"
                    >
                      <template v-slot:suffix>
                        <u-icon size="50" :name="passwordIcon" @click.stop="togglePasswordVisibility"></u-icon>
                      </template>
                    </u-input>
                  </div>
                  <div v-if="loginTab" class="input-label" style="margin-top: 20rpx">验证码</div>
                  <div v-if="loginTab" class="input-field">
                    <u-input
                      prefixIconStyle="width: 36rpx; height: 32rpx; padding-right: 22rpx"
                      prefixIcon="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/17/mima_20250317145953A007.png"
                      class="input_class"
                      placeholder="请输入验证码"
                      v-model="captcha"
                      type="number"
                      maxlength="6"
                    >
                      <template v-slot:suffix>
                        <button class="eye-icon" style="height: 25px; line-height: 25px; padding: 0 10px" v-show="isCode">{{ code_time }}秒后重新获取</button>
                        <button
                          class="eye-icon"
                          @click="code"
                          style="background: red; height: 25px; line-height: 25px; color: #fff; padding: 0 10px"
                          v-show="!isCode"
                          :disabled="sendingCode"
                        >
                          {{ sendingCode ? "发送中..." : "获取验证码" }}
                        </button>
                      </template>
                    </u-input>
                  </div>
                </view>
              </div>

              <div style="margin: 0 auto">
                <button class="login_btn" @click="gotoLogin" :disabled="loggingIn">
                  {{ loggingIn ? "登录中..." : "立即登录" }}
                </button>
              </div>

              <!-- 新增：隐私政策单选框 -->
            </view>
          </div>
        </view>
        <view v-if="!loginPhone">
          <div style="overflow: auto">
            <view class="login_box">
              <view class="login_box_bgi">
                <view style="margin-left: 60rpx; font-size: 30px; color: #000; font-weight: bold; text-align: center"> Hello！</view>
                <view style="margin-left: 60rpx; color: #999999">欢迎来到智享优圈 </view>
              </view>
              <!-- <image style="width: 40px;height: 40px;" src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/06/04/111111111_20250604163103A013.jpg" >
                
              </image> -->
              <div class="bw" style="height: 600rpx">
                <view class="login_box_bgi2" style="display: flex; align-items: center; justify-content: center">
                  <view style="font-size: 34px; color: #000; font-weight: bold; text-align: center"> 智享优圈</view>
                  <view style="color: #999999; font-family: fangsong; margin-top: 5px">登录账号即可查看更多精彩资讯 </view>
                </view>
              </div>

              <div style="margin: 0 auto">
                <button class="login_btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">同意协议并手机号快捷登录</button>
              </div>

              <!-- 新增：隐私政策单选框 -->
            </view>
          </div>
        </view>
        <!-- 新增：隐私政策单选框 -->
        <!-- <div style="margin-top: 20px; padding: 0 20px">
          <u-checkbox-group v-model="agreePrivacy" iconPlacement="left">
            <u-checkbox size="30" iconSize="14px" labelSize="14px" activeColor="red" :name="'同意'"
              :label="'我已阅读并同意'"></u-checkbox>
            <p style="white-space: normal">
              <navigator style="color: #fc4141; font-size: 13px; display: inline"
                url="/pages_h5/myCenter/components/yinsizhengce">《隐私政策》</navigator>
              <navigator style="color: #fc4141; font-size: 13px; display: inline"
                url="/pages_h5/myCenter/components/yonghuxieyi">《平台用户服务协议》</navigator>
              <navigator style="color: #fc4141; font-size: 13px; display: inline"
                url="/pages_h5/myCenter/components/tousujubao">《智享优圈-投诉举报》</navigator>
            </p>
          </u-checkbox-group>
        </div> -->
        <view style="margin-top: 50rpx">
          <u-divider textSize="24" text="其他登录方式"></u-divider>
          <view style="display: flex; flex-direction: column; align-items: center; justify-content: center" v-if="!loginPhone" @click="(loginPhone = true), (loginTab = true)">
            <image style="width: 30px; height: 30px" src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/06/04/手机登录验证_20250604165221A014.png"> </image>
            <span>手机验证</span>
          </view>
          <view
            style="display: flex; flex-direction: column; align-items: center; justify-content: center"
            v-if="loginPhone"
            @click="
              loginPhone = false;
              loginTab = false;
            "
          >
            <image style="width: 30px; height: 30px" src="https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/06/03/快捷登录_20250603140432A021.png"> </image>
            <span>快捷登录</span>
          </view>
        </view>
        <div style="text-align: center; margin-top: 20px; color: bule; font-size: 12px" @click="showLogin = false">暂不登录</div>
      </view>
    </u-popup>
    <!-- <u-modal :closeOnClickOverlay="true" :show="isCodeModal" @confirm="saveImg" @close="isCodeModal = false" cancelText="取消" confirmText="保存到相册">
      <div style="width: 350px; height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center">
        <canvas canvas-id="qrcodes" style="width: 100px; height: 100px"></canvas>
        <div>只要您通过专属邀请二维码推荐一位新朋友加入我们的会员，您将获得新用户消费的部分返佣。</div>
      </div>
    </u-modal> -->
    <u-popup :show="isShow" :round="10" mode="bottom" @close="handleClosePopup">
      <view style="padding: 20px 20px 20px 20px">
        <div style="float: right; color: #999; font-size: 12px" @click="handleClosePopup">暂不设置</div>
        <div style="font-weight: bold; margin-top: 15px; letter-spacing: 1.5px">设置您的昵称与头像</div>
        <div style="font-size: 12px; padding: 5px 0px 10px 0px; border-bottom: 1px solid #ededed">提供具有辨识度的用户中心界面</div>
        <div style="display: flex; height: 60px; font-size: 13px; align-items: center; border-bottom: 1px solid #ededed">
          <div style="width: 60px">头像</div>
          <div>
            <button open-type="chooseAvatar" class="dawdaw" @chooseavatar="onChooseAvatar">
              <image :src="newAvatar.indexOf('http') != -1 ? newAvatar : getImg + newAvatar" style="width: 40px; height: 40px"></image>
            </button>
          </div>
        </div>
        <div style="display: flex; height: 60px; font-size: 13px; align-items: center; border-bottom: 1px solid #ededed">
          <div style="width: 60px">昵称</div>
          <div>
            <input type="nickname" v-model="nickname" placeholder="请输入昵称" />
          </div>
        </div>
        <div style="margin-top: 15px; display: flex; justify-content: center">
          <button class="dawdjnhuhie" open-type="getPhoneNumber" @getphonenumber="awdawgawdgrr">保 存</button>
        </div>
      </view>
    </u-popup>
  </view>
</template>

<script>
import QQMapWX from "../../common/qqmap-wx-jssdk.js";
import { programlogin, phoneAndPassword, getUserInfo, getUserPhoneNumber, newUserIntegral } from "../../utils/request_api.js";
import { IMG_URL } from "../../config/index.js";
import { userEdit } from "../../utils/api/local";
import { notBindingPhone } from "../../utils/api/api.js";
import { checkUserInPolygon, isPointInPolygon } from "../../common/gps.js";
import icon from "uview-ui/libs/config/props/icon.js";
// import uButton from "../../uni_modules/uview-ui/components/u-button/u-button.vue";
export default {
  // components: { uButton },
  data() {
    return {
      yaoiqngID: "",
      isLaundry: "",
      activeId: "",
      businessId: "",
      isShow: false,
      sendingCode: false,
      loginPhone: false,
      // isCodeModal: false,
      loggingIn: false,
      loginTab: false,
      showHb: false,
      getImg: IMG_URL,
      // showCode: false,
      showLogin: false,
      imgUrls: [
        { pic: "https://www.wantongkonggu.cn/crmebimage/public/maintain/2021/12/25/9d95f61a5db84591972fbc90f31c1fb21g5krqax8i.jpg" },
        { pic: "https://www.wantongkonggu.cn/crmebimage/public/maintain/2021/12/25/d4c7282740fb4e71bd2d7e80fad985d8o1wfu26pyd.jpg" },
        { pic: "https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/08/01/生成宣传横图 (1)_20250801143731A038.png" },
      ],
      userInfo: {},
      uid: "",
      MyMenus: [
        /*   {
          name: "我的券包",
          url: "/pages_h5/myCenter/components/myCoupon",
          type: 1,
          permission: true,
        }, */
        {
          name: "本地服务订单",
          url: "/pages_h5/myCenter/components/local_life_order",
          pic: "https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/21/daka_20250321091936A003.png",
          type: 1,
          permission: true,
        },
        {
          name: "支付记录",
          url: "/pages_h5/myCenter/components/payList",
          pic: "https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/21/women_20250321092041A004.png",
          type: 1,
          permission: true,
        },
      ],
      autoplay: true,
      circular: true,
      interval: 3000,
      duration: 500,
      servicePic: "https://www.wantongkonggu.cn/crmebimage/public/maintain/2021/12/25/77ac54ce5f514ebbb89854f927f2a891dzefr2qxmh.png",
      sysHeight: 0,
      pageHeight: "100%",
      account: "",
      password: "",
      authKey: "",
      passwordType: true,
      passwordIcon: "eye",
      agreePrivacy: false,
      ebMerId: "",
      newAvatar: "",
      userType: "",
      nickname: "",
      code_time: 60,
      captcha: "" /* 短信验证码字段 */,
      isCode: false,
      phoneNumber: "",
      amount: "",
      yuanphone: "",
      givephone: "",
      nickName: "",
      shareCode: "",
    };
  },
  onLoad(options) {
    console.log("🚀 ~ onLoad ~ options:", options);
    const q = decodeURIComponent(options.q); // 获取到二维码原始链接内容
    if (q != undefined && q != null && q != "" && q != "undefined" && q != "null") {
      console.log(q);
      console.log("二维码内容执行了!！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！!");

      let wyId = q.split("/")[q.split("/").length - 1].split("-")[0];
      let userTypes = q.split("/")[q.split("/").length - 1].split("-")[1];
      this.amount = q.split("/")[q.split("/").length - 1].split("-")[2] || "";
      this.yuanphone = q.split("/")[q.split("/").length - 1].split("-")[3] || "";
      this.nickName = q.split("/")[q.split("/").length - 1].split("-")[4] || "";
      this.givephone = q.split("/")[q.split("/").length - 1].split("-")[5] || "";
      this.shareCode = q.split("/")[q.split("/").length - 1].split("-")[6] || "";
      uni.setStorageSync("ebMerId", wyId);
      uni.setStorageSync("userType", userTypes);
      this.ebMerId = wyId;
      this.userType = userTypes;
      console.log(this.ebMerId);
      const scancode_time = parseInt(options.scancode_time); // 获取
    } else if (options.shareId) {
      this.ebMerId = options.shareId;
      this.userType = 3;
    } else if (options.yaoqingid) {
      this.ebMerId = options.yaoqingid;
      this.userType = options.useType;
    } else if (options.uid) {
      let wyId = options.uid;
      let userTypes = options.type;
      this.amount = options.amount;
      this.yuanphone = options.fromPhone;
      this.nickName = options.fromNickname;
      this.givephone = options.toPhone;
      this.shareCode = options.shareCode;
      uni.setStorageSync("ebMerId", wyId);
      uni.setStorageSync("userType", userTypes);
      this.ebMerId = wyId;
      this.userType = userTypes;
    } else {
      this.ebMerId = uni.getStorageSync("ebMerId");
      this.userType = uni.getStorageSync("userType");
      /* 商品二维码 */
      this.businessId = uni.getStorageSync("businessId");
      this.activeId = uni.getStorageSync("activeId");
      this.isLaundry = uni.getStorageSync("isLaundry");
      this.iddd = uni.getStorageSync("iddd");
      this.yaoiqngID = uni.getStorageSync("yaoiqngID");
    }
    // this.showloginJs();
    /*  uni.getLocation({
      type: "wgs84",
      success: function (res) {
        uni.setStorageSync("user_latitude", res.latitude);
        uni.setStorageSync("user_longitude", res.longitude);
      },
    }); */
  },
  onPullDownRefresh() {
    if (this.showLogin) {
      return;
    } else {
      uni.showLoading({
        title: "加载中",
      });
      this.initUser222();
      setTimeout(function () {
        uni.hideLoading();
        uni.stopPullDownRefresh();
      }, 500);
    }
  },
  onShow() {
    this.showLogin = false;
    this.showloginJs();

    /*    setTimeout(() => {
      this.initUser222();
    }, 1000); */
    /*  this.showloginJs(); */
    /*  let location = {
      latitude: 23.129163,
      longitude: 113.264435,
    };
    let gps = [
      { latitude: 36.48568834864848, longitude: 115.95053473835631 },
      { latitude: 36.42911918032683, longitude: 115.94204406129148 },
      { latitude: 36.399680005950096, longitude: 115.93496390022635 },
      { latitude: 36.402799237997215, longitude: 116.05299679741644 },
      { latitude: 36.45760822317635, longitude: 116.06999858602597 },
      { latitude: 36.49318472441496, longitude: 116.08616702979779 },
      { latitude: 36.49774574587188, longitude: 116.08559947740258 },
    ];
    var isInside = isPointInPolygon(location, gps);
    console.log(isInside + "affffffffffffffffffffffff"); */
    /* this.checkUserInSpecificArea(); */
  },
  methods: {
    handleClosePopup() {
      // 当用户点击遮罩层关闭弹窗时触发
      this.isShow = false;
    },
    // 示例：检查用户是否在特定区域
    checkUserInSpecificArea(userpoint, syspoint) {
      // 定义一个多边形区域（示例坐标，需要替换为实际区域坐标）

      checkUserInPolygon(userpoint, syspoint)
        .then((isInArea) => {
          if (isInArea) {
            uni.showToast({
              title: "您在指定区域内",
              icon: "success",
            });
            // 执行区域内的业务逻辑
          } else {
            uni.showToast({
              title: "您不在指定区域内",
              icon: "none",
            });
            // 执行区域外的业务逻辑
          }
        })
        .catch((err) => {
          uni.showToast({
            title: "位置检测失败",
            icon: "none",
          });
          console.error("区域检测失败:", err);
        });
    },
    /*     rfgewawdaw() {
      this.isShow = false;
      uni.setStorageSync("isUserInfoEdit", true);
    }, */
    awdawgawdgrr(e) {
      if (e.detail.code && e.detail.errMsg == "getPhoneNumber:ok") {
        getUserPhoneNumber(e.detail).then((res) => {
          if (res.code == 200 && res.data.errmsg == "ok") {
            let that = this;
            var account = res.data.phone_info.phoneNumber;
            var params = {
              avatar: this.newAvatar,
              nickname: this.nickname,
              account: account,
              phone: account,
            };
            userEdit(params).then((res) => {
              if (res.code == 200) {
                uni.setStorageSync("isUserInfoEdit", true);
                uni.showToast({
                  title: "保存成功！",
                });
                this.handleClosePopup();
                this.initUser();
              } else {
                uni.showToast({
                  title: res.message,
                  icon: "none",
                });
                this.handleClosePopup();
                this.initUser();
              }
            });
          } else {
            console.log("🚀 ~ getPhoneNumber ~ res:", res);
            uni.showToast({
              title: res.message,
              icon: "none",
            });
          }
        });
      }
      // if (this.nickname == "") {
      //   uni.showToast({
      //     icon: "none",
      //     title: "请填写完整！",
      //   });
      //   return;
      // }
    },
    onChooseAvatar(e) {
      console.log(e);
      var that = this;
      uni.uploadFile({
        url: "https://www.wantongkonggu.cn//api/frontApph7/frontCommon/uploadTuPian?model=maintain&pid=0",
        filePath: e.detail.avatarUrl,
        name: "multipart",
        formData: {
          model: "maintain",
          pid: 0,
        },
        success: function (uploadRes) {
          const data = JSON.parse(uploadRes.data);
          that.newAvatar = data.fileName;
        },
        fail: function (err) {
          console.error("上传失败", err);
        },
      });
    },

    getPhoneNumber(e) {
      // 在bindgetphonenumber回调中获取code动态令牌
      // this.agreePrivacy = true;

      this.$forceUpdate();
      // if (!this.agreePrivacy) {
      //   uni.showToast({
      //     title: "请阅读并同意隐私政策",
      //     icon: "none",
      //   });
      //   return;
      // }
      if (e.detail.code && e.detail.errMsg == "getPhoneNumber:ok") {
        getUserPhoneNumber(e.detail).then((res) => {
          if (res.code == 200 && res.data.errmsg == "ok") {
            let that = this;
            this.account = res.data.phone_info.phoneNumber;

            this.gotoLogin();
          } else {
            console.log("🚀 ~ getPhoneNumber ~ res:", res);

            uni.showToast({
              title: res.message,
              icon: "none",
            });
          }
        });
      }
    },

    initQrCode() {
      var uid = uni.getStorageSync("uid");
      uni.navigateTo({
        url: "/pages_h5/myCenter/initHb",
      });
    },

    saveImg() {
      const that = this;
      uni.canvasToTempFilePath({
        canvasId: "qrcodes",
        success: function (res) {
          const tempFilePath = res.tempFilePath;
          uni.saveImageToPhotosAlbum({
            filePath: tempFilePath,
            success: function () {
              uni.showToast({
                title: "保存成功!",
                icon: "none",
              });
              // that.isCodeModal = false;
            },
            fail: function (err) {
              console.error("保存图片失败:", err);
              if (err.errMsg.includes("auth denied")) {
                uni.showToast({
                  title: "请先授权保存到相册!",
                  icon: "none",
                });
              } else {
                uni.showToast({
                  title: "保存失败，请重试!",
                  icon: "none",
                });
              }
            },
          });
        },
        fail: function (err) {
          console.error("生成临时图片失败:", err);
          uni.showToast({
            title: "生成临时图片失败，请重试!",
            icon: "none",
          });
        },
      });
    },
    sendSmsCode() {
      this.code_time = 60;
      this.initTime();
      this.isCode = true;
    },
    initTime() {
      // this.code();
      this.timer = setInterval(() => {
        this.code_time--;
        if (this.code_time == 0) {
          clearInterval(this.timer);
          this.isCode = false;
        }
      }, 1000);
    },
    // 获取验证码
    async code() {
      let that = this;
      if (!that.account)
        return uni.showToast({
          title: "请输入正确的手机号码",
          icon: "none",
        });
      if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account))
        return uni.showToast({
          title: "请输入正确的手机号码",
          icon: "none",
        });
      // var formData = new FormData()
      // formData.append('phone', that.account)
      this.sendingCode = true; // 设置正在发送验证码状态
      var params = {
        phone: that.account,
      };
      uni.request({
        url: "https://www.wantongkonggu.cn/api/frontApph7/sendCode",
        data: "\r\n--XXX" + '\r\nContent-Disposition: form-data; name="phone"' + "\r\n" + "\r\n" + that.account + "\r\n--XXX",
        method: "POST",
        header: {
          "Authori-zation": "",
          "Content-Type": "multipart/form-data; boundary=XXX",
        },
        timeout: 10000,
        noAuth: true,
        success: (res) => {
          if (res.data.code == 200) {
            that.sendSmsCode();
            uni.showToast({
              title: "发送成功",
              icon: "none",
            });
            that.sendingCode = false; // 重置发送验证码状态
          } else {
            uni.showToast({
              title: "发送失败" + res.data.message,
              icon: "none",
            });
            that.sendingCode = false; // 重置发送验证码状态
          }
        },
        fail: (err) => {
          uni.showToast({
            title: "发送失败" + err,
            icon: "none",
          });
          that.sendingCode = false; // 重置发送验证码状态
        },
      });
    },
    showloginJs() {
      let that = this;
      let storedOpenID = uni.getStorageSync("openID");
      if (storedOpenID) {
        this.authKey = storedOpenID;
        this.initUser();
      } else {
        uni.login({
          provider: "weixin",
          success: (res) => {
            if (res.code) {
              that.wechatLogin(res.code);
            } else {
              console.error("登录失败:", res.errMsg);
              uni.showToast({
                title: "微信登录失败，请稍后再试",
                icon: "none",
              });
            }
          },
          fail: (err) => {
            console.error("登录失败:", err);
            uni.showToast({
              title: "微信登录失败，请稍后再试",
              icon: "none",
            });
          },
        });
      }
    },

    wechatLogin(code) {
      var that = this;
      wx.getUserInfo({
        success(res) {
          const { nickName, avatarUrl, gender } = res.userInfo;
          programlogin({ code, avatar: avatarUrl, nickName, sex: gender }).then((response) => {
            console.log("🚀 ~ success ~ response:", response);
            /* if (response.code == 200) { */
            const data = response.data;
            that.authKey = data.key;
            that.openid = data.openId;
            if (data.type == "login") {
              uni.setStorageSync("uid", data.uid);
              uni.setStorageSync("token", data.token);
              uni.setStorageSync("userInfo_data", data);
              uni.setStorageSync("openID", data.key);
              that.initUser();
            } else {
              that.initUserLogin();
              // that.showLogin = true;
              // that.loggingIn = false;
            }
            /*  } else {
              uni.showToast({ icon: "none", title: response.message });
            } */
          });
        },
        fail: () => {
          uni.showToast({
            title: "您需要授权，才能获取您的信息！",
          });
          this.showLogin = true;
        },
      });
    },
    initUserLogin() {
      var params = {
        key: this.authKey,
        type: "routine",
        openId: this.openid,
        phone: "",
        password: "",
        captcha: "",
        codeOrPassword: "3",
        inviterLinkId: this.ebMerId ? this.ebMerId : "",
        inviteeType: this.userType,
      };
      notBindingPhone(params).then((res) => {
        if (res.code == 200) {
          const data = res.data;
          uni.setStorageSync("uid", data.uid);
          uni.setStorageSync("token", data.token);
          uni.setStorageSync("userInfo_data", data);
          uni.setStorageSync("openID", this.authKey);
          this.initUser();
          /* this.isShow = true; */
        }
      });
    },
    initUser() {
      getUserInfo()
        .then((res) => {
          if (res.code === 401) {
            uni.showToast({
              title: "您的登录已过期，请重新登录",
              icon: "none",
            });
            uni.clearStorage();
            this.showloginJs();
            // return;
          } else {
            this.userInfo = res.data;
            console.log("🚀 ~ this.userInfo:", this.userInfo);
            this.newAvatar = this.userInfo.avatar;
            this.nickname = this.userInfo.nickname;
            console.log("🚀 ~ this.userInfo.phone:", this.userInfo.phone);
            if (!this.userInfo.phone || this.userInfo.phone == "" || this.userInfo.phone == null) {
              this.isShow = true;
            }
            uni.setStorageSync("userInfo", res.data);
            if (this.givephone != "" && this.givephone != this.userInfo.phone) {
              uni.showToast({
                title: "领取失败,请检查收取人手机号是否正确",
                icon: "none",
              });
              this.givephone = "";
              setTimeout(() => {
                uni.navigateBack({ delta: 1 });
              }, 800);
            } else if (this.amount != "" && this.yuanphone != "" && this.nickName != "" && this.givephone != "" && this.shareCode != "") {
              /* 平台积分拆分 */
              uni.navigateTo({
                url: "/pages_h5/index/components/inviteWuyejifen?amount=" + this.amount + "&yuanphone=" + this.yuanphone + "&nickName=" + this.nickName + "&shareCode=" + this.shareCode,
              });
              this.givephone = "";
            }
          }
        })
        .catch((err) => {
          console.error("获取用户信息失败", err);
        });
    },
    initUser222() {
      getUserInfo()
        .then((res) => {
          if (res.code === 401) {
            uni.showToast({
              title: "您的登录已过期，请重新登录",
              icon: "none",
            });
            /*  uni.clearStorage(); */
            this.showloginJs();
            // return;
          } else {
            this.userInfo = res.data;
            this.newAvatar = this.userInfo.avatar;
            this.nickname = this.userInfo.nickname;
            if (!this.userInfo.phone || this.userInfo.phone == "" || this.userInfo.phone == null) {
              this.isShow = true;
            }
            uni.setStorageSync("userInfo", res.data);
          }
        })
        .catch((err) => {
          console.error("获取用户信息失败", err);
          uni.showToast({
            title: "获取用户信息失败",
            icon: "none",
          });
          /*  uni.clearStorage(); */
          this.showloginJs();
        });
    },
    gotoLogin() {
      let that = this;
      // if (!this.agreePrivacy) {
      //   uni.showToast({
      //     title: "请阅读并同意隐私政策",
      //     icon: "none",
      //   });
      //   return;
      // }
      // if (this.account === "" || (this.password === "" && !this.loginTab)) {
      //   uni.showToast({
      //     title: "请输入账号和密码",
      //     icon: "none",
      //   });
      //   return;
      // }

      const phonePattern = /^1[3-9]\d{9}$/;
      if (!phonePattern.test(this.account) && this.loginTab && this.loginPhone) {
        uni.showToast({
          title: "请输入有效的手机号",
          icon: "none",
        });
        return;
      }
      if (this.loginTab && this.loginPhone && !this.captcha)
        return uni.showToast({
          title: "请输入验证码",
          icon: "none",
        });
      // if (!/^[a-zA-Z][a-zA-Z0-9_]{5,17}$/i.test(this.password) && !this.loginTab)
      //   return uni.showToast({
      //     title: "请输入以字母开头，长度在6~18之间，只能包含字符、数字和下划线的密码",
      //     icon: "none",
      //   });

      this.loggingIn = true; // 设置正在登录状态

      var params = {
        phone: this.account,
        password: this.password,
        captcha: this.captcha,
        key: this.authKey,
        type: "routine",
        codeOrPassword: this.loginTab ? "1" : "3",
        inviterLinkId: this.ebMerId ? this.ebMerId : "",
        inviteeType: this.userType,
      };
      // if (this.merId != '') {
      //   params.inviterLinkId = this.merId
      //   params.inviteeType = 1
      // }
      phoneAndPassword(params)
        .then((res1) => {
          console.log("🚀 ~ gotoLogin ~ res1:", res1);
          console.log("🚀 ~ gotoLogin ~ params:", params);
          if (res1.code === 200) {
            if (res1.data.isNew == true && res1.data.isNew != null) {
              let uid = res1.data.uid;
              let location;
              let giveIntegralLs = res1.data.giveIntegralLs;

              uni.getLocation({
                type: "wgs84",
                success: function (res2) {
                  uni.setStorageSync("user_latitude", res2.latitude);
                  uni.setStorageSync("user_longitude", res2.longitude);
                  location = {
                    latitude: res2.latitude /* 36.461906 */,
                    longitude: res2.longitude /* 116.054227 */,
                  };
                  var isRule = false;
                  var ruleId = "";
                  for (let index = 0; index < giveIntegralLs.length; index++) {
                    if (!isRule) {
                      var element = giveIntegralLs[index].area;
                      var gps = JSON.parse(element);
                      var isInside = isPointInPolygon(location, gps);
                      console.log(isInside + "adddddddddddddddddddddddddddddddddddddddddd");
                      if (isInside) {
                        ruleId = giveIntegralLs[index].id;
                        isRule = true;
                      }
                    }
                  }
                  if (isRule) {
                    newUserIntegral({ uid: uid, type: that.userType, sysConfigGiveIntegralId: ruleId, enrollArea: JSON.stringify(location) }).then((res4) => {
                      /*    let qqmapsdk = new QQMapWX({
                        key: "VKOBZ-UH563-QUB3I-ONVZB-WOYB6-SKFQ4",
                      });
                      qqmapsdk.reverseGeocoder({
                        success: (resd3) => {
                          if (resd3.status == 0) {
                            console.log("🚀 ~ gotoLogin ~ resd3.result.ad_info.district:", resd3.result.ad_info.district);
                            if (resd3.result.ad_info.district == "东昌府区") {
                              console.log("🚀 ~ onLoad ~ resd3.result.ad_info.district:", resd3.result.ad_info.district);
                              newUserIntegral({ uid: uid, type: that.userType }).then((res4) => {
                                console.log("🚀 ~ gotoLogin ~ res4:", res4);
                              });
                            }
                          }
                        },
                        fail: (ress) => {
                          console.error("获取地理位置失败:", ress);
                          uni.showToast({
                            title: "获取地理位置失败,请检查手机定位是否开启",
                            duration: 2000,
                            icon: "none",
                          });
                        },
                      }); */
                      setTimeout(() => {
                        that.loginsssssno(res1);
                      }, 100);
                    });
                  } else {
                    that.loginsssssno(res1);
                  }
                },
                fail: function (err) {
                  console.error("获取定位失败:", err);
                  // 根据错误类型给出不同的提示
                  if (err.errMsg && err.errMsg.includes("auth deny")) {
                    uni.showToast({
                      title: "请授权位置权限以正常使用",
                      duration: 2000,
                      icon: "none",
                    });
                  } else {
                    uni.showToast({
                      title: "获取定位失败，请检查手机定位是否开启",
                      duration: 2000,
                      icon: "none",
                    });
                  }
                  that.loginsssssno(res1);
                },
              });
            } else {
              this.loginsssssno(res1);
            }
          } else {
            console.log("🚀 ~ gotoLogin ~ params:", res1);
            uni.showToast({
              title: res1.message,
              icon: "none",
            });
            this.loggingIn = false; // 重置正在登录状态
          }
        })
        .catch((err) => {
          console.error("登录请求失败", err);
          uni.showToast({
            title: "登录请求失败，请稍后再试",
            icon: "none",
          });
          this.loggingIn = false; // 重置正在登录状态
        });
    },
    loginsssssno(res1) {
      this.userInfo = res1.data;

      uni.setStorageSync("userInfo_data", res1.data);
      this.uid = res1.data.uid;
      uni.setStorageSync("uid", res1.data.uid);
      uni.setStorageSync("token", res1.data.token);
      uni.setStorageSync("openID", res1.data.key);
      this.initUser();
      uni.showToast({
        title: "登录成功！",
        icon: "none",
      });
      this.loggingIn = false;
      this.closebigPop();

      // 商户邀请  返回商户首页
      if (this.userType == 1) {
        // 水站单独判断
        if (this.ebMerId == "1751873058997917") {
          uni.redirectTo({
            url: "/pages_h5/local_life/detailIndex?id=" + this.activeId + "&businessId=" + this.ebMerId + "&isLaundry=" + this.isLaundry,
          });
        } else if (uni.getStorageSync("paybill")) {
          uni.redirectTo({
            url: "/pages_h5/index/components/pay_bill?id=" + this.ebMerId,
          });
        } else {
          uni.redirectTo({
            url: "/pages_h5/index/components/detail?shareMerIdBack=" + this.ebMerId + "&yaoiqngID=" + this.yaoiqngID,
          });
        }
      } else if (this.businessId && this.activeId == "442" && this.isLaundry) {
        /* 鸡蛋判断 */
        uni.redirectTo({
          url: "/pages_h5/local_life/detailIndex?id=" + this.activeId + "&businessId=" + this.businessId + "&isLaundry=" + this.isLaundry,
        });
      } else if (this.givephone != "" && this.givephone != this.userInfo.phone) {
        uni.showToast({
          title: "领取失败,请检查收取人手机号是否正确",
          icon: "none",
        });
        this.givephone = "";
        setTimeout(() => {
          uni.navigateBack({ delta: 1 });
        }, 800);
      } else if (this.amount != "" && this.yuanphone != "" && this.nickName != "" && this.givephone != "" && this.shareCode != "") {
        /* 平台积分拆分 */
        uni.navigateTo({
          url: "/pages_h5/index/components/inviteWuyejifen?amount=" + this.amount + "&yuanphone=" + this.yuanphone + "&nickName=" + this.nickName + "&shareCode=" + this.shareCode,
        });
        this.givephone = "";
      } else if (this.iddd && this.iddd == "10086") {
        console.log("🚀 ~ loginsssssno ~ this.yaoiqngID:", this.yaoiqngID);
        console.log("🚀 ~ loginsssssno ~ this.iddd :", this.iddd);
        uni.redirectTo({
          url: "/pages_h5/index/components/detail?id=" + this.businessId + "&isLaundry=" + this.isLaundry + "&iddd=" + this.iddd + "&yaoiqngID=" + this.yaoiqngID,
        });
      } else {
        console.log("@@@@@@@@@@执行了");

        setTimeout(() => {
          uni.navigateBack({ delta: 1 });
        }, 800);
      }
    },
    togglePasswordVisibility() {
      // 切换密码显示与隐藏
      this.passwordType = this.passwordType === true ? false : true;
      // 切换眼睛图标
      this.passwordIcon = this.passwordIcon === "eye" ? "eye-off" : "eye";
    },
    closebigPop() {
      this.showLogin = false;
    },
    goMenuPage(url) {
      uni.navigateTo({ url });
    },
    goEdit() {
      uni.navigateTo({ url: "/pages_h5/myCenter/components/user_info" });
    },
    bindPhone() {
      uni.navigateTo({ url: "/pages/users/app_login/index" });
    },
    kefuClick() {
      uni.makePhoneCall({ phoneNumber: "06358222555" });
    },
    navito(url) {
      uni.navigateTo({ url });
    },
    /* 登录界面跳转 暂未使用 */
    showLoginPopup() {
      uni.navigateTo({
        url: "/pages_h5/myCenter/login",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.input_CLASDAD {
  width: 95%;
  margin-left: 2.5%;
  height: 70rpx;
  line-height: 70rpx;
  padding-left: 10px;
  border: 1px solid #999;
  border-radius: 10px;
  font-size: 26rpx;
  margin-top: 40rpx;
}

page,
body {
  height: 100%;
  overflow: auto;
}

.new-users {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: auto;
}

.mid {
  flex: 1;
  overflow: hidden;
  padding-top: var(--status-bar-height);
}

.header-bgi {
  background-image: url("https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/03/25/header-bgi_20250325162639A027.png");
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 40vh;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50%;
}

.head {
  padding: 0 30rpx;
}

.user-card {
  position: relative;
  width: 100%;
}

.user-info {
  display: flex;
  align-items: center;
}

.avatar {
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
  margin-right: 20rpx;
}

.info {
  flex: 1;
}

.name {
  display: flex;
  align-items: center;
  font-size: 31rpx;
  color: #1a1a1a;
}

.vip {
  display: flex;
  align-items: center;
  padding: 6rpx 20rpx;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 18px;
  font-size: 20rpx;
  margin-left: 12rpx;
}

.vip image {
  width: 27rpx;
  height: 27rpx;
}

// .num {
//   display: flex;
//   align-items: center;
//   font-size: 26rpx;
//   color: #1a1a1a;
//   margin-top: 10rpx;
// }

.num image {
  width: 22rpx;
  height: 23rpx;
  margin-left: 20rpx;
}

.phone {
  margin-top: 10rpx;
  color: #fff;
  background: #ff6308;
  padding: 8rpx 20rpx;
  border-radius: 10rpx;
}

.mgt-3 {
  margin-top: 30rpx;
  color: #007aff;
  padding: 10rpx 20rpx;
  background: #fff;
  border-radius: 10rpx;
  border: 2rpx solid #007aff;
}

.num-wrapper {
  z-index: 30;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 17px;
  color: #1a1a1a;
}

.num-item {
  width: 33.33%;
  text-align: center;
}

.num-item .num {
  font-size: 38rpx;
  font-weight: bold;
}

.num-item .txt {
  margin-top: 10rpx;
  font-size: 26rpx;
  color: #1a1a1a;
}

.order-wrapper {
  margin-top: 20rpx;
  background-color: #fff;
  border-radius: 14rpx;
  padding: 30rpx 16rpx;
  position: relative;
  z-index: 11;
}

.order-hd {
  display: flex;
  justify-content: space-between;
  font-size: 30rpx;
  color: #282828;
  margin-bottom: 40rpx;
}

.order-hd .left {
  font-weight: 600;
}

.order-hd .right {
  display: flex;
  align-items: center;
  font-size: 26rpx;
  color: #666666;
}

.order-hd .right .icon-xiangyou {
  margin-left: 5rpx;
  font-size: 24rpx;
}

.order-bd {
  display: flex;
  justify-content: space-between;
}

.order-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20rpx 0;
}

.order-item .pic image {
  width: 48rpx;
  height: 48rpx;
}

.order-item .order-status-num {
  min-width: 12rpx;
  background-color: #fff;
  color: #ee5a52;
  border-radius: 15px;
  position: absolute;
  right: -14rpx;
  top: -15rpx;
  font-size: 20rpx;
  padding: 0 8rpx;
  border: 1px solid #ee5a52;
}

.slider-wrapper {
  margin: 20rpx 0;
  height: 138rpx;
  border-radius: 20rpx;
}

.slider-wrapper swiper,
.slider-wrapper swiper-item {
  height: 100%;
  border-radius: 20rpx;
}

.slider-wrapper image {
  width: 100%;
  height: 100%;
  border-radius: 20rpx;
}

.user-menus {
  margin-top: 20rpx;
  background-color: #fff;
  border-radius: 14rpx;
  box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
}

.user-menus .menu-title {
  padding: 30rpx 30rpx 40rpx;
  font-size: 30rpx;
  color: #282828;
  font-weight: 600;
}

.user-menus .list-box {
  display: flex;
  padding: 0 20rpx;
  flex-wrap: wrap;
}

.user-menus .item {
  width: 25%;
  margin-bottom: 47rpx;
  font-size: 26rpx;
  color: #333333;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-menus .item image {
  width: 52rpx;
  height: 52rpx;
  margin-bottom: 18rpx;
}

.qrcode-popup {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.qrcode-popup div {
  background: #fff;
  padding: 20rpx;
  border-radius: 10rpx;
}

.qrcode-popup button {
  margin-top: 20rpx;
  padding: 10rpx 20rpx;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 10rpx;
}

.input-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 86rpx;
  margin-bottom: 38rpx;
  position: relative;

  .eye-icon {
    position: absolute;
    right: 20rpx;
    /* 调整眼睛图标的右边距 */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36rpx;
    height: 36rpx;
  }

  .code {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220rpx;
    height: 86rpx;
    margin-left: 30rpx;
    background: rgba(233, 51, 35, 0.05);
    font-size: 28rpx;
    border-radius: 43rpx;

    &[disabled] {
      background: rgba(0, 0, 0, 0.05);
      color: #999;
    }
  }
}

.input_class {
  flex: 1;
  width: 100%;
  display: block;
  height: 100%;
  padding-left: 40rpx;
  padding-right: 50rpx;
  /* 确保眼睛图标不会覆盖输入的文字 */
  border-radius: 43rpx;
  border: 1px solid #dcdcdc;
  font-size: 24rpx;
}

.login_box {
  height: 100%;
}

.login_box_bgi {
  background-image: url("https://www.wantongkonggu.cn/crmebimage/profile/upload/2025/04/08/矩形 + 椭圆形蒙版@2x_20250408163607A007.png");
  height: 855rpx;
  width: 100%;
  background-size: 100% 100%;
  display: flex;
  /* align-items: center; */
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: -400rpx;
}

.login_box_bgi2 {
  backdrop-filter: blur(0rpx) brightness(100%);
  margin-bottom: 10px;
  border-radius: 10px;
  height: 100%;
  width: 100%;
  background-size: 100% 100%;
  display: flex;
  /* align-items: center; */
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: -400rpx;
}

.login_box_bgi_kuaijie {
  margin-bottom: 122rpx;
  background-color: #fff;
  height: 855rpx;
  width: 100%;
  background-size: 100% 100%;
  display: flex;
  /* align-items: center; */
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* 小程序复制 */
.logo-top {
  width: 100%;
  height: 314px;
}

.logo-container {
  text-align: center;
}

.logo {
  width: 160rpx;
  height: 40rpx;
}

.welcome-text {
  margin-top: 60rpx;
  font-size: 36rpx;
  letter-spacing: 2px;
  font-weight: 500;
  text-align: center;
  font-family: "Arial", sans-serif;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-label {
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 24rpx;
  color: #1a1a1a;
  line-height: 33rpx;
  text-align: left;
  font-style: normal;
}

.input-field {
  margin-top: 10rpx;
  background-color: #f8f8f8;
  height: 80rpx;
  border-radius: 15rpx;
  display: flex;
  align-items: center;
}

.input_class {
  width: 100%;
  height: 60rpx;
  padding: 5rpx 10rpx;
  border: none;
  /* 去除未选中状态边框 */
  outline: none;
  /* 去除选中状态边框 */
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 24rpx;
  line-height: 33rpx;
  text-align: left;
  background: aliceblue;
  border-radius: 20rpx;
  margin: 20rpx 0;
}

.captcha-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.captcha-image {
  width: 400rpx;
  height: 80rpx;
  cursor: pointer;
}

button {
  height: 80rpx;
  line-height: 80rpx;
  background-color: #00dc88;
  color: #fff;
  border: none;
  font-size: 30rpx;
  width: 100%;

  &[disabled] {
    background: #cfd3de;
  }
}

.falsecalss {
  background: #cfd3de;
}

.register-link {
  margin-top: 50rpx;
  text-align: center;
  font-size: 13px;
  color: #999;
  letter-spacing: 3px;
  cursor: pointer;
}

button {
  height: 80rpx;
  line-height: 80rpx;
  background-color: #00dc88;
  color: #fff;
  border: none;
  font-size: 30rpx;
  width: 100%;

  &[disabled] {
    background: #cfd3de;
  }
}

.login_btn {
  width: 578rpx;
  height: 80rpx;
  background: linear-gradient(90deg, #ff5e0b 0%, #ff7c02 100%);
  border-radius: 15rpx;
  font-family: PingFangSC, PingFang SC;
  font-weight: 600;
  font-size: 26rpx;
  color: #ffffff;
  line-height: 37rpx;
  text-align: center;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;

  &[disabled] {
    background: #cfd3de;
  }
}

.dadawda {
  height: calc(100vh + 40px);
}

.dawdaw {
  background: none;
  padding: 0;
  border: none;
  width: 40px;
  height: 40px;
}

.dawdjnhuhie {
  height: 30px;
  line-height: 30px;
  color: #fff;
  width: 100px;
  background-color: #ff5e0b;
  text-align: center;
}
.sblzh {
  // font-size: 16px;
  // text-align: center;
  // color: #ff0800;
  // padding: 0 10px;
  /* letter-spacing: 1.5px ; */
  // border: 1px solid #ff0800;
  // border-radius: 38% 50% 38% 50%;
  // -webkit-transform: rotate(20deg);
  // transform: rotate(20deg);
  position: absolute;
  right: -18px;
  font-family: fangsong;
  font-weight: bold;
  top: -42px;
}
</style>
